package com.yhcnet.blog.reponse;

public class Resp {
    String code;
    String msg;
    Object data;

    //开始
    //成功
    public static Resp OK(){
        return new Resp("200","成功！",null);
    }
    public static Resp OK(Object data){
        return new Resp("200","成功！",data);
    }

    //登录失败
    public static Resp loginFail(){
        return new Resp("400","失败，请重试！",null);
    }

    //结束


    @Override
    public String toString() {
        return "UserResp{" +
                "code='" + code + '\'' +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Resp(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Resp() {
    }
}
